package com.angel.provider.health.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.angel.core.util.Pager;
import com.angel.dao.health.BuzBluetoothMapper;
import com.angel.health.BuzBluetooth;
import com.angel.provider.health.BuzBluetoothProvider;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

/** 
* @author 作者姓名  cheng
* @version 
* 创建时间：2016年10月27日 下午6:24:24 
* 类说明 
*/
@Service
public class BuzBluetoothProviderImpl implements BuzBluetoothProvider {

	@Autowired
	private BuzBluetoothMapper bbtMapper;
	
	@Override
	public Pager findAll(BuzBluetooth bbt,Pager pager) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pager.getCurrentPage(), pager.getPageSize());
		List<Map<String, Object>> list = bbtMapper.findAll(bbt);
		PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(list);
		pager.setTotal(pageInfo.getTotal());
		pager.setTotalPages(pageInfo.getPages());
		pager.setList(pageInfo.getList());
		return pager;
	}

	@Override
	public int insert(BuzBluetooth bbt) {
		// TODO Auto-generated method stub
		return bbtMapper.insert(bbt);
	}

	@Override
	public List<Map<String, Object>> findAllForApp(BuzBluetooth bbt) {
		// TODO Auto-generated method stub
		return bbtMapper.findAll(bbt);
	}

	@Override
	public List<Map<String, Object>> findAll(BuzBluetooth bbt) {
		// TODO Auto-generated method stub
		return bbtMapper.findAll(bbt);
	}

}
